<#assign contextPath=springMacroRequestContext.getContextPath() />
<#import "/public/frame/main.html" as frame />
<@frame.head "南航明珠商城-商品列表">
</@frame.head>

<script type="text/javascript" src="${contextPath}/resources/lib/My97DatePicker/4.8/WdatePicker.js"></script>
<script type="text/javascript" src="${contextPath}/resources/js/laypage/laypage.js"></script>
<script type="text/javascript" src="${contextPath}/resources/js/order/cancle_order_detil.js"></script>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 后台管理中心 <span class="c-gray en">&gt;</span>订单管理 <span class="c-gray en">&gt;</span> 里程退还订单申请  <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<div class="page-container">
<form method="post" name="query_order_form"  id="query_order" action="${contextPath}/order/query_admin_order_detil_list" >    
    <div class="text-c">
        <table class="table">
           <tr>  
           <td>订单编号:
           <input type="text" class="input-text  radius" style="width:250px" placeholder="订单编号" id="orderNo" name="id" value="${order.id}" >
         	 <input class="btn btn-success radius" type="button"  onclick="search();"  value="搜索" />
          </td>
      </table>
      
    </div>
</form>

    <div class="cl pd-5 bg-1 bk-gray mt-20"> 
    <form action="${contextPath}/order/cancle_order_save" method="post" theme="simple" id="cancleOrder"  >
     		 <input type="hidden" name="id" value="${order.id }"/>
			<input type="hidden" name="state" value="${order.state}"/>
			<input type="hidden" name="invoiceHead" value="${order.invoiceHead }" id="isdel"/>
    <table class="table table-border table-bordered table-bg"  id="orderTB">
        <thead>
        <!-- <tr>
            <th scope="col" colspan="9">里程退还订单申请 </th>
        </tr> -->
        <tr   class="text-c" >
            <th width="45px">
             <#if orderDetailList?? && (orderDetailList?size &gt; 0) >
						<input id="chkAll2" name="chkAll2" type="checkbox" value="0" />
			</#if>
									 
          <!--   <input  type="checkbox" id="selectAll" disabled="disabled" onclick="checkAll()"/> -->
            </th>
            <th >商品名称</th>
            <th >商品单价</th>
            <th >商品数量</th>
            <th >商品退还单价</th>
            <th >商品退还数量</th>
          <!--   <th width="150" > 操作</th> -->
        </tr>
        </thead>
        <tbody>
       
      <#if orderDetailList?? && (orderDetailList?size &gt; 0) >
        <#list orderDetailList as orders> 
           <tr>
        	<td style="text-align: center;"> <input type="checkbox" id="chk" name="chk" value="${orders.id}" />	</td>
        	<td>${orders.product.baseInfo.name}	</td>
        	<td>	
        		
 				 <#if  order.orderPayInfo.payType==1 > ${orders.mileages} 里程
 				 <#else> ${orders.mileages}里程+${orders.prices}元
 				</#if>
        	
        	</td>
        	<td>	${orders.buyNum}</td>
        	<td>
        		<input type="hidden" name="checkm" id="tm${orders.id}" value="${orders.mileages}"/>
        		<input style="width: 6	0px;" type="text" id="c_mileages" name="tm${orders.id}" value="${orders.mileages}" onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')" onblur="check_m(this.name);"  />
        		<#if test="order.orderPayInfo.payType==2">
					+${orders.prices}元
				</#if>
        	
        	</td>
        	<td>	
        	<input type="hidden" name="checkn" id="tn${orders.id}" value="${orders.buyNum}"/>										
			<input type="text" id="c_buyNum" name="tn${orders.id}" value="${orders.buyNum}" onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')" onblur="check_n(this.name);"/>
        		
        	</td>
        	 </tr>
        	 


        </#list>
                 <tr >
        	<td colspan="6" >
        	
        	<div class="row cl">
						<label class="form-label col-xs-1 col-sm-1">退单理由:</label>
						<div class="formControls col-xs-8 col-sm-9">
						<textarea class="textarea" placeholder="退单理由..." rows="" cols="" name="remark" id="c_remark"></textarea>
						</div>
				</div>
        	</td>
        </tr>
                  <tr align="center">
        	<td colspan="2" >
        					是否自愿:	
        					<span style="width:200px" class="select-box radius">
        					<select class="select" name="cancelPolicy">
											<option value="F1">是</option>
											<option value="F0">否</option>
										</select>
										</span>
        	</td>
         
        </tr>
        	<tr><td colspan="6" >	<input class="btn btn-success radius" id="commsId1" type="button"  value="申请退还" onclick="comms1();"/></td></tr>
        </#if>
      
       
    	 </tbody>
    </table>
    </form>
    <div id="biuuu_city" style="padding-top: 10px;float: right"></div>
</div>
<@frame.end "default">
</@frame.end>

<script type="text/javascript">
var path="${contextPath}";
laypage({
    cont: 'biuuu_city',//容器。值支持id名、原生dom对象，jquery对象。
    pages: ${pagination.totalPage},//通过后台拿到的总页数
    curr:  ${pagination.pageNo} || 1, //当前页
    jump: function(obj , first){//触发分页后的回调
        if(!first){ //点击跳页触发函数;当前页为obj.curr
          $(page).val(obj.curr);//获取点击的页码
          $(query_order_form).submit();
        }
    }
})  

  $(document).ready(function (){
			
        	//判断是否有错误  1  输入里程数有误  2 输入购买数量有误
			var isdel = $("#isdel").val();
			if(isdel == "1"){
				alert("输入里程数有误！");
			}else if(isdel == "2"){
				alert("输入退还数量有误！");    
			}			

             
         	//全选按钮事件
         	$("#chkAll2").click(function(){
		       			
									if($("#chkAll2").attr("checked")){
										$("input[name='chk']").each(function(){
											this.checked=true;
										});
									}else{
										$("input[name='chk']").each(function(){
											this.checked=false;
										});
									}
						      });
         
         	if("${msg}" == "noPay") {
        		//alert("订单尚未支付"); 
        		layer.msg('订单尚未支付',{icon:1,time:1000},function(){});


        	}
         }
         
         );
		 
			var flag = true;
			
			
				
	
</script>

</body>

</html>
 
